module ApplicationHelper
  def title(page_title, show_title = true)
    content_for(:title) { "Church Admin - #{h(page_title.to_s)}" }
    @show_title = show_title
  end

  def sortable(column, title = nil)
    title ||= column.titleize
    css_class = column == sort_column ? "header #{sort_direction}" : "header"
    direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
    content_tag(:th, link_to(title, params.merge(:sort => column, :direction => direction, :page => nil)), :class => css_class)
  end
end